<!DOCTYPE html>
<html>
<head>
    <title>{$data.title}</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="description" content="{$data.description}" />
    <meta name="keywords" content="{$data.keyword}" />

    <meta name="renderer" content="webkit">
    <meta name="viewport" content="width=device-width, initial-scale=1.0,,maximum-scale=1,minimum-scale=1,user-scalable=no"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,Chrome=1"/>
    <!-- css -->
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
    <link href="__HOME__css/iconfont.css" rel="stylesheet"/>
    <link href="__HOME__css/am.css" rel="stylesheet"/>
    <link href="__HOME__css/flexslider.css" rel="stylesheet"/>
    <link href="__HOME__css/style.css" rel="stylesheet"/>
    <link rel="stylesheet" href="__HOME__css/blueimp-gallery.min.css">
    <style>
        ._share ._view_c a span{color: #1a7e67!important;}
        ._share ._view_c a span:hover{text-decoration: underline;}
    </style>
    {$seo.head}
</head>
<body>
{$seo.body}

<div class="wrap">
    <!--导航-->
    {include file="public/header" /}

    <!-- position -->
    <div class="position_content martp70" style="margin-top: 70px;">
        <div class="public clear">
            <div class="position fl">
                <i class="iconfont icon-zhuye"></i>
                <a href="/">主页</a> >
                <a href="/blog.html">资讯动态</a> >
                <a>{$data.name}</a>
            </div>
            <div class="fr">
                <a href="/blog.html" style="font-size: 16px;color: #7b7b7b;">返回列表 <i class="iconfont icon-fanhui" style="font-size: 18px;"></i></a>
            </div>
        </div>
    </div>
    <!-- position end -->



    <!-- page -->
    <div class="video_view">
        <div class="public clear">
            <div class="video_view_l fl" style="width: 70%">
                <div class="_share">
                    <h1 class="_title">{$data.name}</h1>
                    <div class="clear _date">
                        <div class="fl _date_l">
                            <p><i class="iconfont icon-shijianzhongbiao"></i> {$data.create_time}</p>
                            <p>by <span>{$data.author}</span></p>
                        </div>
                        <div class="fr _date_r">
                            <!-- 分享 -->
                        </div>
                    </div>
                    <div class="_view_c">
                        {$data.content}
                    </div>

                    <div class="_feedback">
                        <div class="total"><h3>{$comm}<span>评论</span></h3></div>
                        <div class="_customer_qa_list">
                            {volist name="message" id="v" key="k"}
                            <div class="_customer_qa">

                                <div class="_question">
                                    <div class="pic clear">
                                        <div class="_icon fl" style="background: url(__HOME__/images/touxiang1.png) center center no-repeat;background-size: cover;width: 60px;height: 60px;"></div>
                                        <h3 class="fl">{$v.name}</h3>
                                    </div>
                                    <div class="_question_c" >
                                        <p>{$v.content}</p>
                                    </div>
                                </div>
                                {if $v.reply neq null}
                                <div class="_answer">
                                    <div class="pic clear">
                                        <div class="_icon fl" style="background: url({$v.reply.img_url}) center center no-repeat;background-size: cover;width: 60px;height: 60px;"></div>
                                        <h3 class="fl">{$v.reply.name}</h3>
                                    </div>
                                    <div class="_question_c">
                                        <p>{$v.reply.content}</p>
                                    </div>
                                </div>
                                <span class="_line"></span>
                                {/if}
                                <span class="_line"></span>
                            </div>
                            {/volist}
                        </div>
                        <div class="_leaveComment _form">
                            <h3>发表评论</h3>
                            <p>您的E-mail地址不会被公开，必填字段已用*标记。</p>
                            <form id="comment" >
                                <textarea class="_inp_text"  type="text" id="content" name="content"   placeholder="请输入评论内容~" autocomplete="off"></textarea>
                                <ul class="col-2 clear" style="overflow: visible;">
                                    <li class="fl">
                                        <input class="_inp_text" type="text" id="name" name="name" required  placeholder="名称 *" autocomplete="off">
                                    </li>
                                    <li class="fl">
                                    <input class="_inp_text" type="text" id="website" name="website"   placeholder="手机号码 *" autocomplete="off">
                                    </li>
                                    <li class="fl">
                                        <input class="_inp_text" type="text" id="email" name="email" required  placeholder="邮箱 " autocomplete="off">
                                    </li>
                                </ul>

                            </form>
                            <a class="_submit" onclick="btnAction()">提交</a>
                        </div>
                    </div>
                    <div class="previousNext clear" style="margin: 0 0 20px 0">
                        {if $c eq null}
                        <div class="fl _previous">
                            <a class="am"><i class="iconfont icon-shangyige"></i>上一个</a>
                            <span>无数据</span>
                        </div>
                        {else \}
                        <div class="fl _previous">
                            <a href="/blog/{$c.id}.html" class="am"><i class="iconfont icon-shangyige"></i>上一个</a>
                            <span title="{$c.name}">{$c.name}</span>
                        </div>
                        {/if}
                        {if $b eq null}
                        <div class="fr _next">
                            <span>无数据</span>
                            <a class="am">下一个<i class="iconfont icon-shangyige"></i></a>
                        </div>
                        {else \}
                        <div class="fr _next">
                            <span title="{$b.name}">{$b.name}</span>
                            <a href="/blog/{$b.id}.html" class="am">下一个<i class="iconfont icon-shangyige"></i></a>
                        </div>
                        {/if}
                        <span class="_link"></span>

                    </div>


                </div>
            </div>
            <div class="video_view_r fr" style="width: 28%">
                <div class="video_view_r_top">
                    <h1 class="_title">相关博客</h1>
                    <div class="_related">
                        <ul>
                            {volist name="likelist" id="v" key="k"}

                            <li>
                                <a href="/blog/{$v.id}.html" class="clear">
                                    <div class="pic fl am">
                                        <div class="pic_img am">
                                            <img src="{$v.img_url}" alt="{$v.alt}" title="{$v.alt}" style="height: 90px;">
                                        </div>
                                    </div>
                                    <div class="_text fl" style="width: 166px">
                                        <span> {$v.create_time}</span>
                                        <p>{$v.name}</p>
                                    </div>
                                </a>
                            </li>
                            {/volist}

                        </ul>
                    </div>
                </div>
                <div class="video_view_r_bottom">
                    <h1 class="_title">标签</h1>

                    <div id="tagscloud" class="_tags">
                        {volist name="tags" id="v" key="k"}
                            <a href="/tags/{$v.id}.html" class="am">{$v.name}</a>
                        {/volist}
                    </div>
                    
                </div>
            </div>
        </div>
    </div>
    <input type="hidden" value="{$data.id}" id="blog_id">


    {include file="public/footer" /}

    <script type="text/javascript">
        //字数限制
        $('._text p').wordLimit(50);
        $('._previous span').wordLimit(22);
        $('._next span').wordLimit(22);
        function btnAction() {

        }
        function btnAction() {
            var data = {
                'name':$('#name').val(),
                'email':$('#email').val(),
                'content':$('#content').val(),
                'website':$('#website').val(),
                'blog_id':$('#blog_id').val()
            };
            $.ajax({
                type: "POST",
                dataType: "json",
                url: '/home/blog/addmessage',
                data: data,
                success: function (res) {
                    var success = JSON.parse(res);
                    if(success.code===200){
                       $('#name').val('');
                        $('#email').val('')
                        $('#content').val('')
                        $('#website').val('')
                        $('#blog_id').val('')
                        alert(success.msg);
                    }else {
                        alert(success.msg);
                    }

                }
            });

        }
    </script>
